package com.weibo4j.api.req.relation;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import com.weibo4j.api.WeiboRequest;
import com.weibo4j.api.response.user.UserGetResponse;
import com.weibo4j.api.util.RequestType;

public class FriendRemarkUpdateRequest extends WeiboRequest<UserGetResponse> {

    private Long    uid;

    private String  remark;

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public String getRemark() {
    	if (remark != null) {
            try {
                return URLEncoder.encode(remark, "utf-8");
            } catch (UnsupportedEncodingException e) {
            }
        }
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public RequestType requestType() {
        return RequestType.POST;
    }

    @Override
    public String baseUrl() {
        return "https://api.weibo.com/2/friendships/remark/update.json";
    }

    @Override
    protected Class<UserGetResponse> responseType() {
        return UserGetResponse.class;
    }

}
